#pragma once

#include "mod.h"

namespace sfc::cmp {

enum Ordering {
  Equal = 0,
  Less = -1,
  Greater = +1,
  Unordered = +2,
};

template <class T>
struct Eq {
  T _0;

  [[sfc_inline]] auto operator()(const auto& other) const -> bool {
    return _0 == other;
  }
};

template <class T>
Eq(T) -> Eq<T>;

template <class T>
struct Ne {
  T _0;
  [[sfc_inline]] auto operator()(const auto& other) const -> bool {
    return _0 != other;
  }
};

template <class T>
Ne(T) -> Ne<T>;

template <class T>
[[sfc_inline]] constexpr auto(max)(const T& a, const T& b) -> T {
  return a > b ? a : b;
}

template <class T>
[[sfc_inline]] constexpr auto(min)(const T& a, const T& b) -> T {
  return a < b ? a : b;
}

}  // namespace sfc::cmp
